<cvc-section-navigation></cvc-section-navigation>
<nz-page-header class="site-page-header">
  <!--title-->
  <!-- <nz-page-header-title>
       <i nz-icon nzType="download"></i>
       Data Releases
       </nz-page-header-title> -->

  <!--content-->
  <nz-page-header-content>
    <!-- title, description, docs links -->
    <nz-row class="header-content">
      <nz-col
        nzFlex="64px"
        class="header-icon">
        <i
          nz-icon
          nzType="download"></i>
      </nz-col>
      <nz-col
        nzFlex="600px"
        class="header-description">
        <h2>Data Releases</h2>
        <p
          nz-typography
          nzEllipsis
          nzExpandable
          [nzEllipsisRows]="2">
          The CIViC server produces nightly and monthly releases that include a
          subset of all primary entity records.
        </p>
      </nz-col>
      <nz-col
        nzFlex="auto"
        class="header-links">
        <nz-space
          nzDirection="vertical"
          class="docs-buttons">
          <a
            nz-button
            href="https://civic.readthedocs.io/en/latest/using/data_releases.html"
            target="_blank"
            nzSize="small"
            nzBlock
            *nzSpaceItem>
            <i
              nz-icon
              nzType="link"
              nzTheme="outline"></i>
            View Data Releases Docs
          </a>
        </nz-space>
      </nz-col>
    </nz-row>
    <nz-space
      nzDirection="vertical"
      nzSpace="large">
      <nz-row *nzSpaceItem>
        <nz-alert
          nzType="info"
          nzMessage="Please Note"
          nzDescription="TSV and VCF releases of CIViC data are provided at regular intervals for the convenience of those who require the use of a static file. For most users, we recomend utilizing our API. Using the API will provide you with the richest metadata about CIViC entries as well as the most current versions of all evidence statements. In fact, the entire CIViC web frontend runs off the exact same API that is available for public use.">
        </nz-alert>
      </nz-row>
      <nz-row *nzSpaceItem>
        <p nz-typography>
          The CIViC server produces nightly and monthly releases that include a
          subset of all primary entity records (Features, Variants, Molecular
          Profiles, Evidence, Variant Groups, and Assertions). Both TSV and VCF
          versions are provided below - just locate the specific entity type and
          data format you wish to obtain, then click on the relevant button to
          download.
        </p>
        <p nz-typography>
          These records do not contain user profile data, discussion and
          commentary, data provenance and revision history, or information
          dynamically obtained from resources external to CIViC (e.g.
          MyVariant.Info, MyGene.Info). Variant TSV releases only include
          variant records with accepted evidence records. Variant TSV releases
          from before August 2020 include all variant records, regardless of the
          status of the associated evidence items. Evidence TSV releases only
          include accepted evidence items and exclude pending or rejected
          evidence items. Assertion TSV releases only include accepted
          assertions. Accepted VCF releases include only variants with accepted
          evidence items and/or accepted assertions. Accepted & Submitted VCF
          releases include Variants with accepted and/or submitted evidence
          items and/or assertions.
        </p>
        <p nz-typography>
          In order to comply with the VCF specification, the VCFs can only
          include variants with complete coordinates. By contrast, the TSV
          variants file may contain variants with coordinates that have not been
          fully curated in CIViC. Additional variants are of types that can not
          be properly represented in VCF format. Thus, the number of variants
          will be lower in the VCFs compared to the number of variants in the
          TSV.
        </p>
        <p nz-typography>
          As with all curated evidence and interpretations of CIViC, the
          contents of these files are made freely available, without restriction
          under the CC0 license (<a
            href="https://creativecommons.org/publicdomain/zero/1.0/"
            target="_blank"
            >Creative Commons Public Domain Dedication, CC0 1.0 Universal</a
          >).
        </p>
        <p nz-typography>
          If you use CIViC content, please consider citing the
          <a
            href="http://www.nature.com/ng/journal/v49/n2/full/ng.3774.html"
            target="_blank"
            >CIViC publication</a
          >.
        </p>
      </nz-row>
      <nz-row *nzSpaceItem>
        <nz-col [nzSpan]="24">
          <div class="content">
            <nz-card nzTitle="Browse All Data Releases">
              <nz-table
                #releasesTable
                nzSize="small"
                [nzData]="(releases$ | ngrxPush) || []"
                [nzLoading]="loading$ | ngrxPush"
                [nzFrontPagination]="true"
                [nzShowPagination]="true"
                [nzPageSize]="5">
                <thead>
                  <tr>
                    <th>Date</th>
                    <th>Features</th>
                    <th>Variants</th>
                    <th>Molecular Profiles</th>
                    <th>Evidence</th>
                    <th>Variant Groups</th>
                    <th>Assertions</th>
                    <th>Accepted Variants VCF</th>
                    <th>Accepted & Submitted Variants VCF</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let release of releasesTable.data">
                    <td>{{ release.name }}</td>
                    <td *ngIf="release.featureTsv; else noData">
                      <cvc-link-tag
                        [href]="release.featureTsv.path"
                        iconName="download">
                        Features TSV
                      </cvc-link-tag>
                    </td>
                    <td *ngIf="release.variantTsv; else noData">
                      <cvc-link-tag
                        [href]="release.variantTsv.path"
                        iconName="download">
                        Variants TSV
                      </cvc-link-tag>
                    </td>
                    <td *ngIf="release.molecularProfileTsv; else noData">
                      <cvc-link-tag
                        [href]="release.molecularProfileTsv.path"
                        iconName="download">
                        Molecular Profiles TSV
                      </cvc-link-tag>
                    </td>
                    <td *ngIf="release.evidenceTsv; else noData">
                      <cvc-link-tag
                        [href]="release.evidenceTsv.path"
                        iconName="download">
                        Evidence TSV
                      </cvc-link-tag>
                    </td>
                    <td *ngIf="release.variantGroupTsv; else noData">
                      <cvc-link-tag
                        [href]="release.variantGroupTsv.path"
                        iconName="download">
                        Variant Groups TSV
                      </cvc-link-tag>
                    </td>
                    <td *ngIf="release.assertionTsv; else noData">
                      <cvc-link-tag
                        [href]="release.assertionTsv.path"
                        iconName="download">
                        Assertions TSV
                      </cvc-link-tag>
                    </td>
                    <td *ngIf="release.acceptedVariantsVcf; else noData">
                      <cvc-link-tag
                        [href]="release.acceptedVariantsVcf.path"
                        iconName="download">
                        Accepted Variants VCF
                      </cvc-link-tag>
                    </td>
                    <td
                      *ngIf="
                        release.acceptedAndSubmittedVariantsVcf;
                        else noData
                      ">
                      <cvc-link-tag
                        [href]="release.acceptedAndSubmittedVariantsVcf.path"
                        iconName="download">
                        Accepted & Submitted Variants VCF
                      </cvc-link-tag>
                    </td>
                  </tr>
                  <ng-template #noData>
                    <td
                      nz-typography
                      nzType="secondary">
                      --
                    </td>
                  </ng-template>
                </tbody>
              </nz-table>
            </nz-card>
          </div>
        </nz-col>
      </nz-row>
    </nz-space>
  </nz-page-header-content>
</nz-page-header>
